$(function () {
    var chartData=$("#chartData")
    chartData.datagrid({
        url:"/chart/query.do",
        fit:true,
        striped:true,
        sortName:"",//默认排序规则
        sortOrder:"",
        pagination:true,
        fitColumns:true,
        columns:[[
            {field:"name",title:"学员名称",width:100},//姓名
            {field:"totlMoney",title:"总学费",width:100},//姓名
            {field:"money",title:"已缴总学费",width:100},
            {field:"owe",title:"未缴总学费",width:100}
        ]],
        toolbar:"#buttons",
        singleSelect: true,
        rownumbers: true,
        pagination: true
    })

    var methodObj= {
        query: function () {
            var keeyWord = $("#keyWord").textbox("getValue")
            var startDate = $("#startDate").datebox("getValue")
            var stopDate = $("#stopDate").datebox("getValue")
            var keyClassName = $("#keyClassName").combobox("getValue");
            chartData.datagrid("load", {
                keyWord: keeyWord,
                startDate: startDate,
                stopDate: stopDate,
                keyClassName: keyClassName
            })
        },
        refresh:function () {
            chartData.datagrid("reload")
        }
    }
    $("a[data-click]").click(function () {
        var incident=$(this).data("click");
        methodObj[incident]();
    })
})